

var map;
function initialize() {

  var myLatlng = new google.maps.LatLng(9.4382, 80.4103);
  var myOptions = {width:650, 
                   height:500,
    zoom: 10,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.TERRAIN
  }
  map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  var roadImage = 'images/roaddev1.jpg';
  var animalImage = 'images/animalhealth1.jpg';  
  var educationImage = 'images/education1.jpg';
  var publicImage = 'images/publicservice1.jpg'; 
  
  placeMarker(new google.maps.LatLng(9.1644, 80.5984), roadImage);
  placeMarker(new google.maps.LatLng(9.3406, 80.1548), roadImage);
  placeMarker(new google.maps.LatLng(9.2281, 80.4006), roadImage);  
  placeMarker(new google.maps.LatLng(9.5641, 80.3979), roadImage); 
  placeMarker(new google.maps.LatLng(9.6156, 80.1713), roadImage);
  
  placeMarker(new google.maps.LatLng(9.1115, 80.3402), animalImage);
  placeMarker(new google.maps.LatLng(9.1725, 80.8154), animalImage);
  placeMarker(new google.maps.LatLng(9.4910, 80.4583), animalImage);  
  placeMarker(new google.maps.LatLng(9.0790, 80.0958), animalImage); 
  placeMarker(new google.maps.LatLng(9.0586, 80.8593), animalImage);

  placeMarker(new google.maps.LatLng(9.2115, 80.7402), educationImage);
  placeMarker(new google.maps.LatLng(9.4025, 80.2154), educationImage);
  placeMarker(new google.maps.LatLng(9.5910, 80.3583), educationImage);  
  placeMarker(new google.maps.LatLng(9.4790, 80.3958), educationImage); 
  placeMarker(new google.maps.LatLng(9.0586, 80.2593), educationImage);   
  
  placeMarker(new google.maps.LatLng(9.1115, 80.5402), publicImage);
  placeMarker(new google.maps.LatLng(9.4025, 80.1154), publicImage);
  placeMarker(new google.maps.LatLng(9.9910, 80.0583), publicImage);  
  placeMarker(new google.maps.LatLng(9.2790, 80.6958), publicImage); 
  placeMarker(new google.maps.LatLng(9.3586, 80.2593), publicImage);   
           
  google.maps.event.addListener(map, 'click', function(event) {
    placeMarker(event.latLng);
  });
}
  
function placeMarker(location, image) {     
      var marker = new google.maps.Marker({
          position: location, 
          map: map,
          icon: image
      });
      var message = "Latitude/Longitude:" + location.lat() + "/" + location.lng();
      var infowindow = new google.maps.InfoWindow(
          { content: message,
            size: new google.maps.Size(50,50)
          });
      google.maps.event.addListener(marker, 'click', function() {
        infowindow.open(map,marker);
      });
}
